using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FiltronASP.Models;

namespace FiltronASP.Areas.Admin.ViewModels.Menus
{
    /// <summary>
    /// ViewModel dla akcji <code>Create</code>, <code>Edit</code>, <code>Delete</code> stron.
    /// </summary>
    public class MenusEditionViewModel : BaseViewModel
    {
        /// <summary>
        /// aktualne menu
        /// </summary>
        public Menu CurrentMenu { get; set; }

        /// <summary>
        /// encja, ktora edytujemy lub dodajemy
        /// </summary>
        public MenuItem MenuItemToOperateWith { get; set; }

        /// <summary>
        /// Biezaca strona paginacji.
        /// </summary>
        public int PaginationPage { get; set; }

        /// <summary>
        /// lista typów stron do drop downa
        /// </summary>
        public IEnumerable<SelectListItem> PageTypesToDropDown { get; set; }

        /// <summary>
        /// Id typu strony z comba.
        /// </summary>
        public int DropDownPageTypeId { get; set; }

        /// <summary>
        /// lista stron do drop downa
        /// </summary>
        public IEnumerable<SelectListItem> PagesToDropDown { get; set; }

        /// <summary>
        /// Id strony z comba.
        /// </summary>
        public int DropDownPageId { get; set; }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        public MenusEditionViewModel()
            : base()
        {
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="menusInMenu">lista menu do menu z lewej</param>
        /// <param name="currentLanguage">aktualnie wybrany język</param>
        /// <param name="paginatedMenuItems">spaginowana lista pozycji menu</param>
        /// <param name="menuItemsTypesToDropDown">lista typów pozycji menu do drop downa</param>
        /// <param name="currentMenu">aktualne menu</param>
        public MenusEditionViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu, 
            IQueryable<Menu> menusInMenu,
            Language currentLanguage,
            Menu currentMenu,
            MenuItem menuItemToOperateWith,
            int paginationPage)
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)
        {
            this.CurrentMenu = currentMenu;
            this.MenuItemToOperateWith = menuItemToOperateWith;
            this.PaginationPage = paginationPage;
        }

        /// <summary>
        /// Konstruktor.
        /// </summary>
        /// <param name="languagesToDropDown">lista jezykow do drop downa</param>
        /// <param name="pageTypesInMenu">lista grup stron do menu z lewej</param>
        /// <param name="menusInMenu">lista menu do menu z lewej</param>
        /// <param name="currentLanguage">aktualnie wybrany język</param>
        /// <param name="paginatedMenuItems">spaginowana lista pozycji menu</param>
        /// <param name="menuItemsTypesToDropDown">lista typów pozycji menu do drop downa</param>
        /// <param name="dropDownPageId">wybrany element w combie</param>
        /// <param name="dropDownPageTypeId">wybrany element w combie</param>
        /// <param name="currentMenu">aktualne menu</param>
        public MenusEditionViewModel(IQueryable<Language> languagesToDropDown,
            IQueryable<PageType> pageTypesInMenu,
            IQueryable<Menu> menusInMenu,
            Language currentLanguage,
            Menu currentMenu,
            MenuItem menuItemToOperateWith,
            IEnumerable<SelectListItem> pageTypesToDropDown,
            int dropDownPageTypeId,
            IEnumerable<SelectListItem> pagesToDropDown,
            int dropDownPageId,
            int paginationPage)
            : base(languagesToDropDown, pageTypesInMenu, menusInMenu, currentLanguage)
        {
            this.CurrentMenu = currentMenu;
            this.MenuItemToOperateWith = menuItemToOperateWith;
            this.PaginationPage = paginationPage;
            this.PageTypesToDropDown = pageTypesToDropDown;
            this.DropDownPageTypeId = dropDownPageTypeId;
            this.PagesToDropDown = pagesToDropDown;
            this.DropDownPageId = dropDownPageId;
        }

    }
}
